package com.dmn.gcode.springchains.adapters;

import com.dmn.gcode.springchains.core.In;

import java.util.Arrays;
import java.util.Set;
import java.util.TreeSet;

/**
 * date 2/3/11
 *
 * @author dvponomarev
 * @version 1.0
 */
public class CommaSeparatedStringsSetAdapter implements In<Set<String>> {
    private String commaSeparatedString;

    public Set<String> get() {
        return new TreeSet<String>(Arrays.asList(commaSeparatedString.trim().split("\\s*,\\s*")));
    }

    public void setCommaSeparatedString(String commaSeparatedString) {
        this.commaSeparatedString = commaSeparatedString;
    }
}
